import { getCoupon } from '@/apis/marketing'
import { ProductModelType } from '../interface/menutabInterface'
import { Button, message, Space } from 'antd';


const orderModel: ProductModelType = {
    namespace: "menuData",
    state: {
        menuInData:[]
    },
    effects: {
        //query就是一个函数，函数的类型Effect
        *query({ payload }, { call, put }): any {
            // const res: any = yield call(getCoupon, payload)
            yield put({
                type: "initData",
                payload: payload
            });

        },


    },
    reducers: {
        initData(state, action) {
            // console.log(action.payload);
            state.menuInData = action.payload
        },
        // subscriptions: { setup: Subscription };
    }
}

export default orderModel